package com.sfzlot.dev.netty;

import com.sfzlot.dev.netty.server.server.SflotServer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.TimeZone;

@SpringBootApplication(scanBasePackages = "com.sfzlot.dev")
public class NettyApplication implements CommandLineRunner {

    @Value("${sfzlot.netty.port}")
    private int port;

    public static void main(String[] args) {
        TimeZone.setDefault(TimeZone.getTimeZone("GMT+8:00"));
        SpringApplication.run(NettyApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        new SflotServer().bind(port);
    }
}
